//package com.zj.sy.config.redis;
//
//
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
//import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.data.redis.connection.RedisConnectionFactory;
//import org.springframework.data.redis.listener.PatternTopic;
//import org.springframework.data.redis.listener.RedisMessageListenerContainer;
//import org.springframework.data.redis.listener.adapter.MessageListenerAdapter;
//
//
//@Configuration
//@ConditionalOnProperty(prefix = "base",name="distributedCache",havingValue = "true")
//@ConditionalOnBean(name="redisTemplate")
//public class RedisPublishSubscribeConfig {
//
//	@Autowired
//	private RedisService redisService;
//
//	// @Bean
//	// public CountDownLatch latch() {
//	// return new CountDownLatch(1);
//	// }
//
//
//	@Bean
//	public MessageListenerAdapter listenerAdapter(DefaultMessageDelegate messageDelegate) {
//		return new MessageListenerAdapter(messageDelegate, "handleMessage");
//	}
//
//
//
//	@Bean
//	public RedisMessageListenerContainer container(RedisConnectionFactory connectionFactory,
//                                                   MessageListenerAdapter listenerAdapter) {
//		RedisMessageListenerContainer container = new RedisMessageListenerContainer();
//		container.setConnectionFactory(connectionFactory);
//		container.addMessageListener(listenerAdapter, new PatternTopic(redisService.getTopic()));
//		return container;
//	}
//
//
////	@Bean
////	public MessageListenerAdapter listenerAdapterFsscSync(OtherMessageDelegate messageDelegate) {
////		return new MessageListenerAdapter(messageDelegate, "handleMessage");
////	}
////
////	@Bean
////	public RedisMessageListenerContainer containerFsscSync(RedisConnectionFactory connectionFactory,
////			MessageListenerAdapter listenerAdapterFsscSync) {
////		RedisMessageListenerContainer container = new RedisMessageListenerContainer();
////		container.setConnectionFactory(connectionFactory);
////		container.addMessageListener(listenerAdapterFsscSync, new PatternTopic(RedisPublisherTopicEnum.FSSC_SYNC.getTopic()));
////		return container;
////	}
//}
